﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WJP.DataPortal.WCF
{
    /// <summary>
    /// HostInfo比较器
    /// </summary>
    internal class HostInfoComparer : IEqualityComparer<HostInfo>
    {
        public static HostInfoComparer Instance = new HostInfoComparer();

        public bool Equals(HostInfo x, HostInfo y)
        {
            return x.Address.CIEquals(y.Address);
        }

        public int GetHashCode(HostInfo obj)
        {
            string address = obj.Address;
            return address != null ? address.ToString().GetHashCode() : 0;
        }
    }
}
